package br.com.extrajudicial.models;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.validator.Min;
import org.hibernate.validator.NotNull;

@Entity
@Table(name="payments")
public class Payment implements Serializable {

	private static final long serialVersionUID = -7085393097738666504L;
	
	@Id
	@GeneratedValue
	private Long id;
	@NotNull
	@Min(0)
	private BigDecimal value;
	
	@JoinColumn (name = "order_id", referencedColumnName = "id")
	@ManyToOne (optional = false)
	private Order order;

	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public BigDecimal getValue() {
		return value;
	}
	public void setValue(BigDecimal value) {
		this.value = value;
	}
	public Boolean getIs_credit() {
		return is_credit;
	}
	public void setIs_credit(Boolean isCredit) {
		is_credit = isCredit;
	}
	@NotNull
	private Boolean is_credit;

	public Order getOrder() {
		return order;
	}
	public void setOrder(Order order) {
		this.order = order;
	}

}
